package com.bawei.mdm2207alast.message

import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.viewinterop.AndroidView
import androidx.navigation.NavController
import androidx.navigation.compose.rememberNavController
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer

/**
 * 作者：赵亮
 * 时间：2024/12/16 14:32
 * 功能：
 */
@Composable
fun MessagePage(navController: NavController = rememberNavController()) {

    Column {
        // 在Compose中使用XML中的控件
        AndroidView(factory = {
           /* val gsyVideoPlayer = StandardGSYVideoPlayer(it)
            gsyVideoPlayer.setUp("http://10.59.9.18/video/small/commodity/3.mp4", true, "美丽的视频")
            gsyVideoPlayer*/
            val webView = WebView(it)
            webView.webViewClient = WebViewClient()
            webView.loadUrl("http://www.baidu.com")
            webView
        })
    }
}

@Preview
@Composable
fun MessagePagePreview() {
    MessagePage()
}

